import { createApp } from 'vue'
import App from './App.vue'
// reset style sheet
import '@/styles/reset.scss'
// CSS common style sheet
import '@/styles/common.scss'
// custom element dark css
import '@/styles/element-dark.scss'
// element css
import 'element-plus/dist/index.css'
// element dark css
import 'element-plus/theme-chalk/dark/css-vars.css'
// custom element css
import '@/styles/element.scss'
// vue Router
import router from '@/routers'
// pinia store
import pinia from '@/stores'
// vue i18n
import I18n from '@/languages/index'
// element icons
import * as Icons from '@element-plus/icons-vue'
async function setupApp() {
  const app = createApp(App)

  // register the element Icons component
  Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key as keyof typeof Icons])
  })

  app.use(router)

  app.use(pinia)

  app.use(I18n)

  app.mount('#app')
}

setupApp()
